home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_robo_zapdead.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  130 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_IMP1_Pistons.cog
  4. # This is the generic door with a camera attached
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     entered
  15.     message     pulse
  16.     message     crossed
  17.     
  18.     thing       player                                      local
  19.     
  20.     thing       source0
  21.     thing       source1
  22.     thing       source2
  23.     thing       source3
  24.     
  25.     thing       target0
  26.     thing       target1
  27.     thing       target2
  28.     thing       target3
  29.     
  30.     sector      dedsector
  31.     
  32.     surface     crostrigger
  33.     
  34.     thing       lightning_strike                            local
  35.     thing       strike_sector                               local
  36.     
  37.     template    sparks=bluesparks                              local
  38.     template    smoke0=+pistol_smoke1                        local
  39.     template    lightzap=+lightningzap                        local
  40.     template    lighthit=+lightninghit                        local
  41.     
  42.     material    lightningmat0=inf_4sfx_lightning_a.mat        local
  43.     material    lightningmat1=inf_4sfx_lightning_b.mat        local
  44.     material    lightningmat2=inf_4sfx_lightning_c.mat        local
  45.     material    lightningmat3=inf_4sfx_lightning_d.mat        local
  46.         
  47.     int         pulsetime=2                                 local
  48.     int         cnt=0                                       local
  49.     int         count                                       local
  50.     int         trigger=0                                   local
  51.     
  52.     vector      player_pos                                  local
  53.     
  54.     sound        contact0=gen_lightning_contact_c.wav        local
  55.     sound       contact1=gen_lightning_contact_c.wav        local
  56.     sound       contact2=aet_lightning_04.wav               local
  57.     
  58.       
  59. end
  60.  
  61.  
  62. code
  63.  
  64. #........................................................................................
  65.  
  66. startup:
  67.     //inital conditions
  68.     player = GetLocalPlayerThing();
  69.  
  70. return;
  71.  
  72. #........................................................................................
  73.  
  74. crossed:
  75.     if ((GetSenderRef() == crostrigger) && (trigger == 0))
  76.     {
  77.         SetPulse(1.1);
  78.         trigger=1;
  79.     }
  80.     
  81. return;        
  82.  
  83. #........................................................................................
  84.  
  85. pulse:
  86.     //lightning strikes
  87.     count = RandBetween(0, 3);
  88.     PlaySoundThing(contact0[RandBetween(0, 2)], source0[count], 1, 5, 15, 0);
  89.     for (cnt = 4; cnt <= RandBetween(4, 12); cnt = cnt + 1)
  90.     {
  91.         lightning_strike = CreatePolylineThing(source0[count], target0[count], '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  92.         Sleep(0.05); 
  93.     }
  94.         
  95. return;
  96.  
  97. #........................................................................................
  98.  
  99. entered:
  100.     //kill the player for a bad move
  101.     if ((GetSenderRef() == dedsector) && (GetSourceRef() == player))
  102.     {
  103.     
  104.         //print("indy gets hit");
  105.         SetActorFlags(player, 0x200000);
  106.         StopThing(player);
  107.         player_pos = VectorAdd(GetThingPos(player), '0 0 0.05');
  108.         for (cnt = 4; cnt <= RandBetween(4, 8); cnt = cnt + 1)
  109.         {
  110.             CreatePolylineThing(source0[count], player_pos, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  111.             Sleep(0.05); 
  112.         }
  113.         CreateThingAtPos(sparks, GetThingSector(player), player_pos, '0 0 0');
  114.         CreateThingAtPos(smoke0, GetThingSector(player), player_pos, '0 0 0');
  115.         CreateThingAtPos(lighthit, GetThingSector(player), player_pos, '0 0 0');
  116.         //CreateThingAtPos(lightzap, GetThingSector(player), player_pos, '0 0 0');
  117.         DamageThing(player, 1000, 0x2, source0[count]);
  118.         //PlayKey(player, inShocked, 4, 0x12, 0);
  119.         Sleep(1);
  120.         ClearActorFlags(player, 0x200000);
  121.         
  122.     }
  123.     
  124. return;
  125.  
  126. #........................................................................................
  127. end
  128.  
  129.  
  130.